package com.allwees.bs.module.pms.req.query;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.allwees.bs.core.modelbase.req.QueryReq;
import com.allwees.bs.module.pms.entity.Sku;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.util.Assert;

@Data
@EqualsAndHashCode(callSuper = true)
public class SkuQueryReq extends QueryReq<Sku> {
    private String[] productUuids;

    @Override
	protected void buildQuery(QueryWrapper<Sku> queryWrapper) {
    	Assert.notEmpty(productUuids, "productUuids不能为空");
    	queryWrapper.in(ArrayUtils.isNotEmpty(productUuids), "product_uuid", productUuids);
	}
}
